<%@ Import Namespace="octalforty.Componento.Web.Shared.Data"%>
<%@ Import Namespace="octalforty.Componento.Web.Repository.Core"%>
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Component>>" ContentType="text/xml" ResponseEncoding="utf-8" %><?xml version="1.0" encoding="utf-8" ?>
<components xmlns="http://schemas.componento.net/1.0/components.xsd">
    <% foreach(var component in Model) { %>
    <component name="<%= component.Name %>" version="<%= component.Version %>" manifest-uri="<%= Url.AbsoluteAction("ComponentManifestXml", "Components", new { componentName = component.Name, componentVersion = component.Version }).ToLowerInvariant() %>"
        project-uri="<%= component.ProjectUri %>" project-logo-uri="<%= component.ProjectLogoUri %>">
        <description><![CDATA[<%= component.Description %>]]></description>
        <% if(component.ComponentClis.Count > 0) { %>
            <clis>
            <% foreach(var cli in component.ComponentClis) { %>
                <% if(!string.IsNullOrEmpty(cli.Version)) { %>
                <cli name="<%= cli.Cli %>" version="<%= cli.Version %>" />
                <% } else { %>
                <cli name="<%= cli.Cli %>" />
                <% } %>
            <% } %>
            </clis>
        <% } %>
        
        <% if(component.ComponentIsas.Count > 0) { %>
            <isas>
                <% foreach(var isa in component.ComponentIsas) { %>
                    <isa name="<%= isa.Isa %>" />
                <% } %>
            </isas>
        <% } %>
        
        <% if(component.ComponentLicenses.Count > 0) { %>
            <licenses>
                <% foreach(var license in component.ComponentLicenses) { %>
                    <license name="<%= license.License %>" />
                <% } %>
            </licenses>
        <% } %>
    </component>
    <% } %>
</components>
